using System;
using System.Collections.Generic;
using System.Data;
using Orchard.ContentManagement.Drivers;
using Orchard.ContentManagement.MetaData;
using Orchard.ContentManagement.MetaData.Builders;
using Orchard.Core.Contents.Extensions;
using Orchard.Data.Migration;

namespace Mod.DisplayTypes {
    public class Migrations : DataMigrationImpl {

        public int Create() {
			// Creating table DisplayTypePartRecord
			SchemaBuilder.CreateTable("DisplayTypePartRecord", table => table
				.ContentPartRecord()
			);

            ContentDefinitionManager.AlterPartDefinition("DisplayTypePart",
                cfg => cfg.Attachable());

            return 1;
        }

        public int UpdateFrom1()
        {
            SchemaBuilder.AlterTable("DisplayTypePartRecord", t =>
                t.AddColumn<string>("Pathz"));

            return 2;
        }
    }
}